import { storeBindingsBehavior } from 'mobx-miniprogram-bindings'
import { store } from '../../store/store'

Component({
  behaviors: [storeBindingsBehavior],
  data: {
    someData: '...'
  },
  storeBindings: {
    store,
    fields: {
      numA: () => store.numA,
      numB: (store) => store.numB,
      sum: 'sum'
    },
    actions: {
      updateNumA: 'updateNumA'
    },
  },
  methods: {
    async getInfo () {
      const { data: res } = await wx.p.request({
        url: 'https://www.escook.cn/api/get',
        method: 'GET',
        data: {
          name: 'zs',
          age: 19
        }
      })
    
      console.log(res)
    },
    btnHandler1 (e) {
      this.updateNumA(e.target.dataset.step)
    }
  }
})